MAIN_OBJ	= Main.o GPUSAMatch_kernel.o SAMatch.o test_driver.o ResultConverter.o ReadSet.o GPU2BWT_api.o Index.o 2BWTSearch.o 2BWTSearch_cpu.o Match_cpu.o OccValue_cpu.o integer.o coproc.o compressTitle_cpu.o compressOutput_cpu.o findMisMatch.o compress_cpu.o compress_gpu.o compressOutput_gpu.o alignerOutput.o 
CUDA_HOME       = /home/yuwei/NVIDIA_GPU_Computing_SDK
NVCC_HOME	= /usr/local/cuda
CC              = g++
NVCC            = nvcc 
INCLUDE         = -I../common -I../gsnp/cpp -I../container -I./cpp -I$(NVCC_HOME)/include -I$(CUDA_HOME)/C/common/inc 
LIB             = -L/usr/local/lib -L$(NVCC_HOME)/lib64 -L$(CUDA_HOME)/C/lib -lcutil_x86_64 -lcuda -lcudart -lpthread -L../container -lcontainer -L../gsnp -lcmat
CFLAGS          = -O3 -g
NVCCFLAGS       = -O3 -gencode arch=compute_20,code=sm_20


galigner: $(MAIN_OBJ)
	$(CC) -o galigner $(MAIN_OBJ) $(CFLAGS) $(INCLUDE) $(LIB)
test_driver.o: ./cpp/test_driver.cpp
	$(CC) -c ./cpp/test_driver.cpp $(CFLAGS) $(INCLUDE)
SAMatch.o: ./cpp/SAMatch.cpp
	$(CC) -c ./cpp/SAMatch.cpp $(CFLAGS) $(INCLUDE)
ResultConverter.o: ./cpp/ResultConverter.cpp
	$(CC) -c ./cpp/ResultConverter.cpp $(CFLAGS) $(INCLUDE)
ReadSet.o: ./cpp/ReadSet.cpp
	$(CC) -c ./cpp/ReadSet.cpp $(CFLAGS) $(INCLUDE)
GPU2BWT_api.o: ./cpp/GPU2BWT_api.cpp
	$(CC) -c ./cpp/GPU2BWT_api.cpp $(CFLAGS) $(INCLUDE)
Index.o: ./cpp/Index.cpp
	$(CC) -c ./cpp/Index.cpp $(CFLAGS) $(INCLUDE)
Main.o: ./cpp/Main.cpp
	$(CC) -c ./cpp/Main.cpp $(CFLAGS) $(INCLUDE)
2BWTSearch.o: ./cpp/2BWTSearch.cu
	$(NVCC) -c ./cpp/2BWTSearch.cu $(NVCCFLAGS) $(INCLUDE)
integer.o: ./cpp/integer.cpp
	$(CC) -c ./cpp/integer.cpp $(CFLAGS) $(INCLUDE)
coproc.o: ./cpp/coproc.cpp
	$(CC) -c ./cpp/coproc.cpp $(CFLAGS) $(INCLUDE)
2BWTSearch_cpu.o: ./cpp/2BWTSearch_cpu.cpp
	$(CC) -c ./cpp/2BWTSearch_cpu.cpp $(CFLAGS) $(INCLUDE)
Match_cpu.o: ./cpp/Match_cpu.cpp
	$(CC) -c ./cpp/Match_cpu.cpp $(CFLAGS) $(INCLUDE)
OccValue_cpu.o: ./cpp/OccValue_cpu.cpp
	$(CC) -c ./cpp/OccValue_cpu.cpp $(CFLAGS) $(INCLUDE)
compressTitle_cpu.o: ./CompressAlign/cpp/compressTitle_cpu.cpp
	$(CC) -c ./CompressAlign/cpp/compressTitle_cpu.cpp $(CFLAGS) $(INCLUDE)
compressOutput_cpu.o: ./CompressAlign/cpp/compressOutput_cpu.cpp
	$(CC) -c ./CompressAlign/cpp/compressOutput_cpu.cpp $(CFLAGS) $(INCLUDE)
compress_cpu.o: ./CompressAlign/cpp/compress_cpu.cpp
	$(CC) -c ./CompressAlign/cpp/compress_cpu.cpp $(CFLAGS) $(INCLUDE)
alignerOutput.o: ./cpp/alignerOutput.cpp
	$(CC) -c ./cpp/alignerOutput.cpp $(CFLAGS) $(INCLUDE)
findMisMatch.o: ./cpp/findMisMatch.cpp
	$(CC) -c ./cpp/findMisMatch.cpp $(CFLAGS) $(INCLUDE)
GPUSAMatch_kernel.o:
	$(NVCC) -c ./cpp/GPUSAMatch_kernel.cu $(NVCCFLAGS) $(INCLUDE)
compress_gpu.o: ./CompressAlign/cpp/compress_gpu.cu
	$(NVCC) -c ./CompressAlign/cpp/compress_gpu.cu $(CFLAGS) $(INCLUDE)
compressOutput_gpu.o: ./CompressAlign/cpp/compressOutput_gpu.cu
	$(NVCC) -c ./CompressAlign/cpp/compressOutput_gpu.cu $(CFLAGS) $(INCLUDE)
all: galigner

clean:
	rm -f *.o galigner builder
